package com.atguigu.tms.mock.mapper;

import com.atguigu.tms.mock.bean.BaseComplex;
import com.atguigu.tms.mock.mapper.adv.AdvMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author zhangchen
 * @since 2022-06-12
 */
public interface BaseComplexMapper extends AdvMapper<BaseComplex> {



    @Select(" SELECT concat(prov.name, city.name,dist.name) district_name ,prov.id  province_id,  city.id city_id,  dist.id  district_id  FROM base_region_info dist , " +
            "  base_region_info city , base_region_info prov " +
            "  WHERE  dist.dict_code='District'  AND city.dict_code='City' AND prov.dict_code='Province' " +
            "  AND dist.parent_id=city.id AND city.parent_id = prov.id and city.id in (${cityId}) ")
    public List<BaseComplex> selectAddressList(@Param("cityId") String cityId);
}
